home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / xpk_source / test / printflags.c < prev    next >
C/C++ Source or Header  |  1998-08-27  |  645b  |  44 lines

  1. #include <xpk/xpk.h>
  2. #include <proto/dos.h>
  3.  
  4. /* Includesheader
  5.  
  6.     Name:        PrintFlags.c
  7.     Versionstring:    $VER: PrintFlags.c 1.0 (06.12.96)
  8.     Author:        SDI
  9.     Distribution:    Freeware
  10.     Description:    prints flags
  11.  
  12.  1.1   06.12.96 : build with GetXpkSubLibData.c code
  13. */
  14.  
  15. ULONG PrintFlag(ULONG *data, ULONG flag, STRPTR str)
  16. {
  17.   if(*data & flag)
  18.   {
  19.     PutStr(str);
  20.     *data ^= flag;
  21.     if(*data)
  22.     {
  23.       PutStr("|");
  24.       return 2;
  25.     }
  26.     return 1;
  27.   }
  28.   return 0;
  29. }
  30.  
  31. ULONG PrintEndFlag(ULONG data, ULONG origdata)
  32. {
  33.   if(data)
  34.   {
  35.     VPrintf("%ld\n",&data);
  36.     return 1;
  37.   }
  38.   else if(!origdata)
  39.     PutStr("0");
  40.   PutStr("\n");
  41.   return 0;
  42. }
  43.  
  44.